﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Composite
{
  public   class Employee
    {
      private string Name;
      private string Dept;
      private int Salary;
      private List<Employee> SubBordinates;
      public Employee(string name,string dept,int salary)
      {
          this.Name = name;
          this.Dept = dept;
          this.Salary = salary;
          this.SubBordinates = new List<Employee>();
      }
      public List<Employee> GetSubBordinates()
      {
          return this.SubBordinates;
      }
      public void Add(Employee emp)
      {
          this.SubBordinates.Add(emp);
      }
      public void Remove(Employee emp)
      {
          this.SubBordinates.Remove(emp);
      }
      public string ToString(Employee emp)
      {
          return string.Format("Employee:[Name:{0},Dept:{1},Salary:{2}", emp.Name, emp.Dept, emp.Salary);
      }
    }
}
